Note: This statement is not available in the Add Statement dialog box or the Statements pane.
Returns True or False to indicate if a property name exists in a JSONObject.
Syntax
HasProperty("PropertyName")
Arguments
| Argument | Description |
|---|---|
| PropertyName | Property in the JSONObject. |
Supported objects
Return value
| Value | Description |
|---|---|
| True | Property exists in the JSONObject. |
| False | Property does not exist in the JSONObject. |
Example
jsonObject = JSONNewObject()
' Adds values to JSONObject
jsonObject.SetValue("PropertyName1", 1)
jsonObject.SetValue("PropertyName2", 2)
' Returns True
boolVal = jsonObject.HasProperty("PropertyName1")
PrintLn("Should be True: " & boolVal)